﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MadProps
{
    public class Composition
    {
        readonly LinkedList<IComposable> items;

        internal Composition(LinkedList<IComposable> items)
        {
            this.items = items.ThrowIfNull("items");
        }

        internal IEnumerable<T> ResolveAll<T>()
        {
            return items.OfType<T>();
        }

        static Composition theDefault = Composer.StandardBuild().Compose();
        public static Composition Default()
        {
            return theDefault;
        }
    }
}
